<?php

/*
  |--------------------------------------------------------------------------
  | Application Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register all of the routes for an application.
  | It's a breeze. Simply tell Laravel the URIs it should respond to
  | and give it the Closure to execute when that URI is requested.
  |
 */
Route::resource('car', 'CarController');
Route::get('users', 'UserController@index');

Route::post('goto', array('uses' => 'BaseController@gotoraiffeisen'));
Route::post('failure', array('uses' => 'BaseController@failure'));
Route::post('success', array('uses' => 'BaseController@success'));
Route::post('notifyurl', array('uses' => 'BaseController@notifyurl'));

Route::get('users/google_login', array('uses' => 'UserController@loginWithGoogle'));

Route::get('alert_messages', array('uses' => 'AlertController@index'));

Route::post('users/register', array('uses' => 'UserController@store'));
Route::post('users/signin', array('uses' => 'UserController@doLogin'));
Route::get('users/logout', array('uses' => 'UserController@doLogout'));
Route::post('paypal', array('uses' => 'HomeController@showPaypal'));
Route::get('calendar', array('uses' => 'CalendarController@index'));

Route::group(array('before' => 'auth'), function() {
    Route::get('/', 'ReportController@index');
    Route::get('all_vehicles', 'CarController@index');
    Route::get('users/pending', array('uses' => 'UserController@pending_users'));
    Route::get('users/roles', array('uses' => 'UserController@users_roles'));
    Route::get('reports', array('uses' => 'ReportController@index'));
    Route::get('check_in_search', array('uses' => 'RentalController@check_in_search'));
    Route::get('repairs/delete/{id}', array('uses' => 'RepairController@destroy_repair'));
    Route::get('customer_rental/{id}', array('uses' => 'RentalController@customer_rental'));
    Route::get('customer_new_rental/{id}', array('uses' => 'RentalController@customer_new_rental'));
    Route::get('check_in/{id}', array('uses' => 'RentalController@check_in'));
    Route::get('repair_parts/delete/{id}', array('uses' => 'RepairController@destroy_repairPart'));
    Route::get('owner_cert/delete/{id}', array('uses' => 'CarController@destroy_ownerCert'));
    Route::get('sgs/delete/{id}', array('uses' => 'CarController@destroy_sgs'));
    Route::get('tpl/delete/{id}', array('uses' => 'CarController@destroy_tpl'));
    Route::get('kasko/delete/{id}', array('uses' => 'CarController@destroy_kasko'));
    Route::get('inter_permis/delete/{id}', array('uses' => 'CarController@destroy_interPermis'));

    Route::get('drive_permis/delete/{id}', array('uses' => 'CarController@destroy_drivePermis'));
    Route::get('authoriz/delete/{id}', array('uses' => 'CarController@destroy_authoriz'));
    Route::get('process/delete/{id}', array('uses' => 'MaintenanceController@destroy_processes'));
    Route::post('existing_customers', array('uses' => 'RentalController@existing_customers'));
    Route::post('update', array('uses' => 'CarController@update'));
    Route::post('free_cars', array('uses' => 'RentalController@show_freeCars'));
    Route::post('show_reservation', array('uses' => 'RentalController@show_reservation'));
    Route::get('maintenance_print', array('uses' => 'MaintenanceController@maintenance_print'));
    Route::get('repairParts_create', array('uses' => 'RepairController@create_repairPart'));
    Route::get('repair_problem/{id}', array('uses' => 'RepairController@repair_problem'));
    Route::get('insurDocs_print', array('uses' => 'CarController@insurDocs_print'));
    Route::get('history', array('uses' => 'CarController@history'));
    Route::get('customer', array('uses' => 'CustomerController@index'));

    Route::post('/upload_pic', array('uses' => 'CustomerController@upload_pic'));
    Route::post('/upload_patent', array('uses' => 'CustomerController@upload_patent'));
    Route::post('/upload_customer_patent', array('uses' => 'RentalController@upload_customer_patent'));
    Route::post('/upload_customer_image', array('uses' => 'RentalController@upload_customer_image'));
    Route::post('/upload_images', array('uses' => 'CarController@upload_images'));
    Route::post('/upload_docs', array('uses' => 'CarController@upload_docs'));
    Route::get('images_galery/{id}', 'CarController@images_galery');
    Route::get('customer_pic/{id}', 'CustomerController@customer_pic');
    Route::get('customer_patent/{id}', 'CustomerController@customer_patent');
    Route::get('rental_patent/{drpasportId}/{id}', 'RentalController@rental_patent');
    Route::get('rental_image/{drpasportId}/{id}', 'RentalController@rental_image');
    Route::get('docs_galery/{id}', 'CarController@docs_galery');
    Route::get('download_ownerCertDoc/{id}', 'CarController@download_ownerCertDoc');
    Route::get('download_sgsDoc/{id}', 'CarController@download_sgsDoc');
    Route::get('download_tplDoc/{id}', 'CarController@download_tplDoc');
    Route::get('download_kaskoDoc/{id}', 'CarController@download_kaskoDoc');

    Route::get('repair_parts/edit/{id}', array('uses' => 'RepairController@edit_repairParts'));
    Route::get('reservation/edit/{id}', array('uses' => 'RentalController@edit'));
    Route::get('maintenance/edit/{id}', array('uses' => 'MaintenanceController@edit'));
    Route::get('repair/edit/{id}', array('uses' => 'RepairController@edit_repair'));
    Route::get('download_drivePermisDoc/{id}', 'CarController@download_drivePermisDoc');
    Route::get('download_interPermisDoc/{id}', 'CarController@download_interPermisDoc');
    Route::get('download_authorizDoc/{id}', 'CarController@download_authorizDoc');

    Route::get('online_reservations', array('uses' => 'BookingController@index'));
    Route::get('online_logs', array('uses' => 'BookingController@online_logs'));
    Route::get('insert_history', array('uses' => 'CarController@insert_history'));
    Route::get('delete_history', array('uses' => 'CarController@delete_history'));
    Route::get('rental_payment/{id}', array('as' => 'rental_payment', 'uses' => 'RentalController@rental_payment'));
    Route::put('insur_docs/update/{id}', array('as' => 'insur_docs.update', 'uses' => 'Insur_DocController@update'));
    Route::put('reservation/update/{id}', array('as' => 'res.update', 'uses' => 'RentalController@update'));
    Route::put('check_in/update/{id}', array('as' => 'check_in.update', 'uses' => 'RentalController@checkin_update'));
    Route::put('repairs/update/{id}', array('as' => 'repairs.update', 'uses' => 'RepairController@update_repair'));
    Route::post('store', array('store' => 'CarController@store'));
    Route::post('repair_problem/store', array('uses' => 'RepairController@repair_prob_store'));
    Route::post('customer_store', array('uses' => 'CustomerController@store'));
    Route::post('reservation_store', array('uses' => 'RentalController@store'));
    Route::post('rental_store', array('uses' => 'RentalController@rental_store'));
    Route::put('customer_save/{id}', array('as' => 'customer_save', 'uses' => 'RentalController@customer_save'));
    Route::post('customer_rental_save', array('uses' => 'RentalController@customer_rental_save'));
    Route::post('insur_docs/store', array('uses' => 'Insur_DocController@store'));
    Route::get('vehicle_maintenance', 'MaintenanceController@vehicle_maintenance');
    Route::get('vehicle_repair', 'RepairController@vehicle_repair');
    Route::post('repair/store', array('uses' => 'RepairController@store'));

    Route::get('repair_parts', array('uses' => 'RepairController@index_repairParts'));
    Route::get('processes', array('uses' => 'MaintenanceController@processes'));
    Route::post('repair_parts/store', array('uses' => 'RepairController@store_repairParts'));
    Route::get('repair/others', array('uses' => 'RepairController@other_repairs'));
    Route::get('new_rental', array('uses' => 'RentalController@index'));
    Route::get('upload_patent_rental/{drpasportId}/{id}', array('uses' => 'RentalController@upload_patent_rental'));

    Route::get('all_rentals', array('uses' => 'RentalController@all_rentals'));
    Route::get('all_reservations', array('uses' => 'RentalController@all_reservations'));
    Route::get('new_reservation', array('uses' => 'RentalController@create'));
    Route::get('problems_create', array('uses' => 'RepairController@problems_create'));
    Route::get('contract_show/{id}', array('as' => 'contract_show', 'uses' => 'RentalController@contract_show'));
    Route::get('problems/{id}', array('uses' => 'RepairController@problems'));
    Route::get('repair/{id}', array('uses' => 'RepairController@index'));
  
    Route::get('success/filter', array('uses' => 'CarController@success_filter'));
    Route::get('danger/filter', array('uses' => 'CarController@danger_filter'));
    Route::get('create_customers', array('uses' => 'CustomerController@create'));
    Route::get('create_process', array('uses' => 'MaintenanceController@create_processes'));

    Route::get('warning/filter', array('uses' => 'CarController@warning_filter'));
    Route::get('reservation/create/{id}', array('uses' => 'RentalController@reservation_create'));
    Route::get('rental/create/{id}', array('uses' => 'RentalController@rental_create'));
    Route::get('rental_invoice/{id}', array('uses' => 'RentalController@rental_invoice'));
    Route::get('online_invoice/{id}', array('uses' => 'BookingController@online_invoice'));
    Route::get('repair/create/{id}', array('uses' => 'RepairController@create'));
    Route::get('customer/{id}', array('uses' => 'CustomerController@show'));
    Route::get('{id}', array('uses' => 'CarController@show'));
    Route::get('create', array('uses' => 'CarController@create'));
    Route::get('insur_docs/create', array('uses' => 'Insur_DocController@create'));
    Route::get('edit/{id}', array('uses' => 'CarController@edit'));
    Route::get('insur_docs/{id}', 'Insur_DocController@edit');
    Route::get('maintenance/{id}', 'MaintenanceController@index');
    Route::post('problems/store', array('uses' => 'RepairController@problems_store'));
    Route::post('maintenance/store', array('uses' => 'MaintenanceController@store'));
    Route::post('processes/store', array('uses' => 'MaintenanceController@store_processes'));
    Route::get('maintenance_history/{id}', 'MaintenanceController@maintenance_history');
    Route::get('maintenance/create/{id}', array('uses' => 'MaintenanceController@create'));

    Route::get('roles_edit/{id}', array('uses' => 'UserController@edit_roles'));
    Route::get('pending_edit/{id}', array('uses' => 'UserController@edit'));
    Route::put('maintenance_update/{id}', array('as' => 'maintenance.update', 'uses' => 'MaintenanceController@update'));
    Route::put('pending_update/{id}', array('as' => 'pending.update', 'uses' => 'UserController@update'));
    Route::put('roles_update/{id}', array('as' => 'roles.update', 'uses' => 'UserController@update_roles'));
    Route::put('repair_parts/update/{id}', array('as' => 'repair_parts.update', 'uses' => 'RepairController@update_repairParts'));
    Route::get('file/upload/{id}', array('uses' => 'CarController@getDownload'));
});
Route::get('language/{lang}', array(
    'as' => 'language.select',
    'uses' => 'LanguageController@select'
));

